#ifndef REDIS_H
#define REDIS_H

#include "DataModel.hpp"
#include "hashDataModel.h"
#include "listDataModel.h"
#include "setDataModel.h"
#include "stringDataModel.h"
#include "Singleton.hpp"

#include <sstream>
#include <iostream>

enum class RedisDataType {
    STRING,
    HASH,
    SET,
    ZSET,
    LIST
};

class Redis : public Singleton<Redis> {
    friend class Singleton<Redis>;
protected:
    Redis();
    ~Redis();
public:
    std::string command(const std::string& command);
private:
    DataModel* plantDataModel(const std::string& type);
    void initCommandTypes();

private:
    std::unordered_map<std::string, DataModel*> redis;
    std::unordered_map<std::string, RedisDataType> commandTypes;
};

#endif // REDIS_H